package com.mkyong.android;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;

public class AppActivity extends Activity 
	{

	Button button;

	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.begin);
		addListenerOnButton();
	}

	public void addListenerOnButton() 
	{

		final Context context = this;
		button = (Button) findViewById(R.id.button1);
		button.setOnClickListener(new OnClickListener() 
		{

			public void onClick(View arg0) 
			{

				Intent intent = new Intent(context, App2Activity.class);
                startActivity(intent);   

			}

		});

	}

}